home *** CD-ROM | disk | FTP | other *** search
/ BBS Toolkit / BBS Toolkit.iso / doors_1 / dfqbx26.zip / PBC-SUBS.DOC < prev    next >
Text File  |  1992-09-25  |  37KB  |  1,107 lines

  1.  
  2.  The following routines are available for your use. DoorFrame itself does not
  3. use most of the routines so you may retain or delete them from DFRAMEX.LIB as
  4. you see fit (the ones DoorFrame uses are noted - DON'T DELETE THEM!). The
  5. library is modularized so if you don't CALL a routine in your code, it will
  6. not be included in the final .EXE file. Since these routines come from the
  7. PBClone library by Tom Hanlin, I have taken the liberty of including his
  8. descriptions of the routines.
  9.  
  10. Name  : BigPrint             (Called by DoorFrame - DON'T DELETE!)
  11. Class : Display
  12. Level : BIOS
  13.  
  14. As the name suggests, this routine displays text in large
  15. characters.  How large?  Eight times as high and as wide as
  16. normal!  Each "big character" will be composed of many
  17. normal-sized characters.  You may choose the normal character
  18. used to create the big characters (the default is a CHR$(219)
  19. solid block character, if you pass a null string here).
  20.  
  21. You should avoid using CHR$(128) to CHR$(255) when in either of
  22. the CGA graphics modes, as many CGAs are unable to display
  23. these characters when in graphics mode.
  24.  
  25.    BigPrint St$, FormCh$, Row%, Column%, Attr%
  26.  
  27. St$       string to display in big characters
  28. FormCh$   character used to compose the big characters
  29. Row%      starting row
  30. Column%   starting column
  31. Attr%     color/attribute of big characters (see CalcAttr)
  32.           NOTE: This is a local only procedure. It will NOT be sent to the
  33.                 remote computer!
  34.  
  35.  
  36. Name  : CalcAttr                (Called by DoorFrame - DON'T DELETE!)
  37. Class : Display
  38. Level : Any
  39.  
  40. An attribute is a combination of the foreground and background colors in a 
  41. format which is used by all types of displays when in text mode. 
  42.  
  43. Foreground colors are usually specified as 0-15, with backgrounds as 0-7.
  44.  
  45.    CalcAttr Foreground%, Background%, Attr%
  46.  
  47. Foreground%  foreground color
  48. Background%  background color
  49. -------
  50. Attr%        color "attribute"
  51.  
  52.  
  53. Name  : CalcDate             (Calculate Date)
  54. Class : Time
  55. Level : Any
  56.  
  57. This routine calculates what the date will be a given number of
  58. days from now, either in the past or the future.  Actually, you
  59. may use any starting date, not just the current date.  An error
  60. code is returned if the starting date or resulting date are not
  61. valid.  Dates may not preceed January 1, 1900.
  62.  
  63. CalcDate accepts the date in any standard form ("01/30/91" or
  64. "01-30-1991", for example) and returns its results in the same
  65. format.
  66.  
  67.    CalcDate StartDate$, Days&, Direction%, NewDate$, ErrCode%
  68.  
  69. StartDate$   starting date
  70. Days&        number of days from the current date (0 or more)
  71. Direction%   return future result (0) or past (nonzero)
  72. -------
  73. NewDate$     resulting date
  74. ErrCode%     whether the dates are valid (0 yes)
  75.  
  76.  
  77. Name  : CDROM
  78. Class : Disk / Equipment
  79. Level : DOS
  80.  
  81. This routine tells you whether the Microsoft CD-ROM Extensions are installed.
  82. If so, it tells you what the letter of the first CD-ROM logical drive is and
  83. how many logical drives exist.
  84.  
  85. Note: The CD-ROM installation check conflicts with the GRAPHICS.COM
  86. installation check for DOS 4.0, due to some screw-up at IBM or Microsoft.
  87. This may cause unexpected results.  I'm not yet sure whether DOS 5.0 is
  88. similarly afflicted.
  89.  
  90.    FirstDrive$ = "x"
  91.    CDROM FirstDrive$, Drives%
  92.  
  93. -------
  94. FirstDrive$   letter of the first logical drive (init to at least one space!)
  95. Drives%       number of logical drives available (0 if no CD-ROM is there)
  96.  
  97.  
  98. Name  : CheckDate            (Check Date validity)
  99. Class : Time
  100. Level : Any
  101.  
  102. This routine checks a date to see if it is valid.
  103.  
  104.    CheckDate MonthNr%, DayNr%, YearNr%, ErrCode%
  105.  
  106. MonthNr%     month number (1-12)
  107. DayNr%       day number (1-31)
  108. YearNr%      year number (1900 on; years <100 assumed 1900s)
  109. -------
  110. ErrCode%     whether the date is valid (0 yes)
  111.  
  112.  
  113. Name  : CheckShare           (Check for SHARE)
  114. Class : Disk
  115. Level : DOS
  116.  
  117. The CheckShare routine determines whether SHARE.EXE is active.
  118. This is particularly helpful before using the BASIC OPEN
  119. statement, which will fail if you request file sharing when
  120. it's not available.  The PBClone file routines handle such
  121. situations automatically, so CheckShare is not needed for them.
  122.  
  123.    CheckShare ShareActive%
  124.  
  125. -------
  126. ShareActive%   whether SHARE is active (0 if no)
  127.  
  128.  
  129. Name  : CheckShare2%         (Check for SHARE)
  130. Class : Disk
  131. Level : DOS
  132.  
  133. The CheckShare2% function determines whether SHARE.EXE is active.  This is
  134. particularly helpful before using the BASIC OPEN statement, which will fail
  135. if you request file sharing when it's not available.  The PBClone file
  136. routines handle such situations automatically, so CheckShare2% is not needed
  137. for them.
  138.  
  139.    ShareActive% = CheckShare2%
  140.  
  141. -------
  142. ShareActive%   whether SHARE is active (0 if no)
  143.  
  144.  
  145. Name  : DateA2R              (Date Actual to Relative)
  146. Class : Time
  147. Level : Any
  148.  
  149. This routine converts an actual date to a relative date,
  150. expressed as a number of days.  This allows you to compare
  151. dates, find out what the date will be in a given number of days
  152. (or what it was a given number of days ago), see how many days
  153. passed between two dates, and so forth.
  154.  
  155. I've frequently seen routines of this nature called "Julian
  156. date" routines. I'm not sure where that nomenclature
  157. originated, as it has nothing to do with the Julian calendar.
  158. Most of these routines rely on approximations through floating
  159. point math, and may or may not handle leap years and centuries
  160. appropriately.  The DateA2R routine takes no such shortcuts and
  161. may be relied upon to return accurate results.
  162.  
  163.    DateA2R MonthNr%, DayNr%, YearNr%, RelDate&
  164.  
  165. MonthNr%     month number (1-12)
  166. DayNr%       day number (1-31)
  167. YearNr%      year number (1900 on; years <100 assumed in 1900s)
  168. -------
  169. RelDate&     relative date
  170.  
  171.  
  172. Name  : DateN2S              (Date Numbers to String)
  173. Class : Time
  174. Level : Any / DOS
  175.  
  176. Many of the PBClone routines return the date as a set of
  177. numbers.  This routine provides an easy way to convert those
  178. numbers into string form.  The date format used (year length
  179. and delimiter) will be based on the string which you pass to
  180. the routine.  For instance, "xx-xx-xxxx" will return a date
  181. like "11-26-1990", whereas "xx.xx.xxxx" would return
  182. "11.26.1990", and "xx/xx/xx" would return "11/26/90".
  183.  
  184. If you pass zeroes for the MonthNr%, Day%, and Year% values,
  185. the current date will be returned in the format that you
  186. specified.
  187.  
  188. The ProBas and PBClone versions of this routine do not work the
  189. same way in regards to the year.  ProBas assumed that any
  190. two-digit year was in the 1900s.  In contrast, PBClone assumes
  191. that years 80-99 should be converted to 1980-1999 and that 0-79
  192. should be converted to 2000-2079.
  193.  
  194.    DateSt$ = "xx-xx-xxxx"
  195.    DateN2S MonthNr%, Day%, Year%, DateSt$
  196.  
  197. MonthNr%  month
  198. Day%      day
  199. Year%     year
  200. -------
  201. DateSt$   date string.  Init to 8 or 10 chars (see above).
  202.  
  203.  
  204. Name  : DateR2A              (Date Relative to Actual)
  205. Class : Time
  206. Level : Any
  207.  
  208. This is the opposite of the DateA2R routine-- it takes a
  209. "relative" date and converts it back to the usual form.
  210.  
  211.    DateR2A MonthNr%, DayNr%, YearNr%, RelDate&
  212.  
  213. RelDate&     relative date
  214. -------
  215. MonthNr%     month number (1-12)
  216. DayNr%       day number (1-31)
  217. YearNr%      year number (1900 on)
  218.  
  219.  
  220. Name  : DateS2N              (Date String to Numbers)
  221. Class : Time
  222. Level : Any
  223.  
  224. Many of the PBClone routines need to be passed the date as a
  225. set of numbers. This routine provides an easy way to convert a
  226. date from string form into numbers.  You may use either
  227. "xx/xx/xx" or "xx-xx-xxxx" form to specify the date (the string
  228. length is important, but the delimiter and contents of the
  229. string are ignored).
  230.  
  231. The ProBas and PBClone versions of this routine do not work the
  232. same way in regards to the year.  ProBas assumed that any
  233. two-digit year was in the 1900s.  In contrast, PBClone assumes
  234. that years 80-99 should be converted to 1980-1999 and that 0-79
  235. should be converted to 2000-2079.
  236.  
  237.    DateS2N MonthNr%, Day%, Year%, DateSt$
  238.  
  239. DateSt$   date string.  Init to 8 or 10 characters (see above).
  240. -------
  241. MonthNr%  month
  242. Day%      day
  243. Year%     year
  244.  
  245.  
  246. Name  : DelFile
  247. Class : Disk
  248. Level : DOS
  249.  
  250. This works like the DOS DEL (or ERASE) command, although it does not allow
  251. wildcards.  The specified file is deleted.  Full path specifications are
  252. supported, including drive and subdirectory specs.
  253.  
  254.    DelFile FileName$, ErrCode%
  255.  
  256. FileName$   name of the file to delete
  257. -------
  258. ErrCode%    0 if no error, else DOS Error
  259.  
  260.  
  261. Name  : DriveSpace&
  262. Class : Disk
  263. Level : DOS
  264.  
  265. This routine tells you how many bytes are free on a specified disk drive.
  266.  
  267.    BytesFree& = DriveSpace&(Drive$)
  268.  
  269. Drive$      letter of the drive to examine
  270. -------
  271. BytesFree&  free bytes on the specified drive, or -1 if bad drive or disk error
  272.  
  273.  
  274. Name  : DrvType              (Drive Type)
  275. Class : Disk
  276. Level : DOS 3.1+
  277.  
  278. The DrvType routine tells you whether a specified drive is
  279. fixed or removeable, and whether it is local or remote (network
  280. drive).
  281.  
  282.    DrvType Drive$, Removeable%, Remote%, ErrCode%
  283.  
  284. Drive$       letter of the drive to examine
  285. -------
  286. Removeable%  whether the disk can be removed (0 if no)
  287. Remote%      whether this is a remote drive (0 if no)
  288. ErrCode%     error code: 0 if none, else bad DOS version
  289.  
  290. Name  : Elapsed              (Elapsed time)
  291. Class : Time
  292. Level : Any
  293.  
  294. This routine tells you the amount of time elapsed between a
  295. given starting time and ending time.  The difference between
  296. the times must be less than 24 hours for the results to be
  297. meaningful.
  298.  
  299.    Elapsed TimeStart$, TimeStop$, TimeDiff$
  300.  
  301. TimeStart$   starting time
  302. TimeStop$    ending time
  303. -------
  304. TimeDiff$    elapsed time
  305.  
  306. Name  : EMSBuffer
  307. Class : Memory
  308. Level : BIOS
  309.  
  310. EMSBuffer tells you how many bytes are needed to save the state of the EMS
  311. array routines.  Used in conjunction with EMSSave and EMSRest, it allows you
  312. to preserve EMS arrays across a CHAIN to another part of your program.
  313.  
  314.    EMSBuffer Bytes%
  315.    EMSState$ = SPACE$(Bytes%)
  316.    EMSSave EMSState$
  317.  
  318. -------
  319. Bytes%       bytes needed to save EMS array state
  320.  
  321. Name  : EMSClose
  322. Class : Memory
  323. Level : BIOS
  324.  
  325. The EMSClose routine is used when you are finished with an EMS array.  It
  326. frees the array handle and EMS memory for other uses.  If you don't close all
  327. EMS arrays before your program ends, the memory will be lost until the system
  328. is rebooted, so it is important to remember EMSClose.
  329.  
  330.    EMSClose ArrayHandle%
  331.  
  332. ArrayHandle%    handle of an EMS array
  333.  
  334.  
  335. Name  : EMSGet
  336. Class : Memory
  337. Level : BIOS
  338.  
  339. This routine gets an element from an EMS array created by EMSOpen.  Element
  340. numbers start at 0.  Be sure to use the right numeric type for the array--
  341. for instance, if you opened the array for SINGLE precision, use "Value!".
  342.  
  343.    EMSGet ArrayHandle%, ElementNr&, Value
  344.  
  345. ArrayHandle%    handle of an EMS array
  346. ElementNr&      element number to get
  347. -------
  348. Value           value to get element into (must be correct type for array)
  349.  
  350.  
  351. Name  : EMSOpen
  352. Class : Memory
  353. Level : BIOS
  354.  
  355. This routine allows you to open a block of EMS (expanded) memory which can
  356. then be accessed like a numeric array.  The array size is limited only by
  357. available EMS memory (use GetLIMM to find out how much is available).  You
  358. may specify any numeric type:
  359.  
  360.     1   INTEGER
  361.     2   LONG or SINGLE
  362.     3   DOUBLE
  363.  
  364. When the array is opened, you are returned an "array handle" which is used to
  365. access that array.  Access to the array is done via EMSGet and EMSPut.  When
  366. you are finished with the array, you must close it with EMSClose.
  367.  
  368. As many as 25 EMS arrays can be in use at one time, subject to limitations
  369. which may be imposed by your EMS driver (each array requires one EMS handle).
  370.  
  371.    EMSOpen Elements&, ElementType%, ArrayHandle%, ErrCode%
  372.  
  373. Elements&       number of elements in array (like DIM size)
  374. ElementType%    numeric type of array (see above)
  375. -------
  376. ArrayHandle%    handle of an EMS array
  377. ErrCode%        whether an error occurred (0 no)
  378.  
  379.  
  380. Name  : EMSPut
  381. Class : Memory
  382. Level : BIOS
  383.  
  384. This routine puts an element into an EMS array created by EMSOpen.  Element
  385. numbers start at 0.  Be sure to use the right numeric type for the array--
  386. for instance, if you opened the array for SINGLE precision, use "Value!".
  387.  
  388.    EMSPut ArrayHandle%, ElementNr&, Value
  389.  
  390. ArrayHandle%    handle of an EMS array
  391. ElementNr&      element number to set
  392. Value           value to set element to (must be correct type for array)
  393.  
  394.  
  395. Name  : EMSRest
  396. Class : Memory
  397. Level : BIOS
  398.  
  399. This routine allows you to restore the state of the EMS array handler.  Used
  400. in conjunction with EMSBuffer and EMSSave, it allows you to preserve EMS
  401. arrays across a CHAIN to another part of your program.
  402.  
  403.    EMSRest EMSState$
  404.  
  405. EMSState$    saved EMS array state
  406.  
  407.  
  408. Name  : EMSSave
  409. Class : Memory
  410. Level : BIOS
  411.  
  412. This routine allows you to save the state of the EMS array handler.  Used in
  413. conjunction with EMSBuffer and EMSRest, it allows you to preserve EMS arrays
  414. across a CHAIN to another part of your program.
  415.  
  416.    EMSBuffer Bytes%
  417.    EMSState$ = SPACE$(Bytes%)
  418.    EMSSave EMSState$
  419.  
  420. -------
  421. EMSState$    saved EMS array state
  422.  
  423.  
  424. Name  : EnhKbd
  425. Class : Input
  426. Level : BIOS
  427.  
  428. By default, the PBClone routines assume an old-style keyboard is in use, for
  429. greatest compatibility.  EnhKbd allows you to turn on enhanced keyboard
  430. handling for the current generation of (usually) 101-key keyboards.  This
  431. allows access to the F11 and F12 function keys as well as codes for key
  432. combinations that used to be ignored, among other things.
  433.  
  434. The KbdType or KbdType2% routine can be used to determine if an enhanced
  435. keyboard is available (recommended).
  436.  
  437. Note that EnhKbd works by intercepting the BIOS keyboard handler.  All calls
  438. to the BIOS keyboard interrupt are converted from the old keyboard functions
  439. to the new ones.  YOU MUST DISABLE EnhKbd BEFORE YOUR PROGRAM ENDS, so it can
  440. restore the old setup.  Otherwise, the computer will most probably crash.
  441.  
  442.    EnhKbd Enable%
  443.  
  444. Enable%     turn on enhanced keyboard support (0 disable, else enable)
  445.  
  446.  
  447. Name  : EuropeDate           (European Date format)
  448. Class : Time
  449. Level : Any
  450.  
  451. This routine takes a date in one of the American formats
  452. ("MM/DD/YY" or "MM-DD-YYYY") and converts it to the European
  453. convention ("DD.MM.YY" or "DD.MM.YYYY").  The date is formatted
  454. according to a format string which provides the desired
  455. delimiter and year length, e.g. "##-##-##" specifies a
  456. delimiter of "-" and a year length of two digits.
  457.  
  458. An error code is returned if the date is not valid.
  459.  
  460.    EuropeDate DateSt$, Format$, Result$, ErrCode%
  461.  
  462. DateSt$     date to format (month, day, year order)
  463. Format$     format for the date
  464. -------
  465. Result$     resulting date (day, month, year order)
  466. ErrCode     whether the date is valid (0 ok)
  467.  
  468.  
  469. Name  : FormatDate           (Format Date)
  470. Class : Time
  471. Level : Any
  472.  
  473. This is a highly flexible date formatting routine.  It accepts
  474. a date in one of the usual American formats ("03-22-1990",
  475. "03/22/90", or even "3/22/90") and converts it according to a
  476. format string.  This format string allows you to normalize the
  477. date, select a new delimiter, choose between two-digit and
  478. four-digit years, and even change the order from month/day/year
  479. to anything else.  An error code will be returned if the date
  480. is not valid.
  481.  
  482. The format string can be as simple as "##/##/##", which
  483. specifies that the usual month/day/year order be used, with a
  484. delimiter of "/" and a two-digit year.  If you want to change
  485. the date order, you would need a format like "DD.MM.YYYY"
  486. instead.  For sorting or storage, you might want to convert the
  487. date to a plain number, using a format string like "YYYYMMDD".
  488. The result could then be converted to a LONG with the BASIC VAL
  489. function.
  490.  
  491.    FormatDate DateSt$, Format$, Result$, ErrCode%
  492.  
  493. DateSt$     date to format (month, day, year order)
  494. Format$     format for the date
  495. -------
  496. Result$     resulting date
  497. ErrCode     whether the date is valid (0 ok)
  498.  
  499.  
  500. Name  : Get4DOSv             (Get 4DOS Version)
  501. Class : Equipment
  502. Level : DOS
  503. The Get4DOSv routine returns the version of 4DOS being used.  It returns the
  504. results as two integers containing the major and minor version numbers. For
  505. instance, 4DOS 4.0 would return a major number of 4, minor 0.  If 4DOS is not
  506. installed, both version numbers will be zero.
  507. If you're not familiar with 4DOS, it's a terrific improved replacement for
  508. COMMAND.COM.  For more information, write JP Software Inc., P.O. Box 1470,
  509. Arlington MA 02174, or call your local BBS.
  510.  
  511.    Get4DOSv MajorV%, MinorV%
  512.  
  513. -------
  514. MajorV%   major part of the 4DOS version
  515. MinorV%   minor part of the 4DOS version
  516.  
  517. Name  : GetDOSV                 (Called by DoorFrame - DON'T DELETE!)
  518. Class : Equipment
  519. Level : DOS
  520. The GetDOSV routine tells you what version of DOS you're using.  It returns
  521. the results as two integers containing the major and minor version numbers.
  522. For instance, MS-DOS 2.11 would return a major number of 2, minor 11.
  523.  
  524. The OS/2 compatibility box returns version numbers beginning at 10.00.  For
  525. instance, OS/2 v1.1 returns 10.10 and OS/2 v2.0 returns 20.00.
  526.  
  527.    GetDOSV MajorV%, MinorV%
  528.  
  529. -------
  530. MajorV%   major part of the DOS version
  531. MinorV%   minor part of the DOS version
  532.  
  533. Name  : Getdrv               (Get default Drive)
  534. Class : Disk
  535. Level : DOS
  536.  
  537. This routine tells you the letter of the current default drive.
  538.    Drive$ = "x"
  539.    GetDrv Drive$
  540.  
  541. -------
  542. Drive$    default drive letter.  Init to at least one character.
  543.  
  544. Name  : GetDView
  545. Class : Miscellaneous
  546. Level : DOS
  547.  
  548. The GetDView routine tells you what version of DESQview is loaded.  It
  549. returns the results as two integers containing the major and minor version
  550. numbers.  For instance, DESQview 2.0 would return a major number of 2 and a
  551. minor number of 0.  If DESQview is not loaded, zeroes are returned.
  552. See also GetTView, GetTVScreen, UpdTVScreen.
  553.  
  554.    GetDView MajorV%, MinorV%
  555.  
  556. -------
  557. MajorV%   major part of the DESQview version (0 if DESQview is not loaded)
  558. MinorV%   minor part of the DESQview version
  559.  
  560.  
  561. Name  : GetexecPath          (Get Execution Path of program)
  562. Class : Disk
  563. Level : DOS 3.0+
  564.  
  565. This routine returns the full path of your program, i.e., the
  566. drive, subdirectory, and name of the program.  It does not rely
  567. on the current drive and subdirectory settings or look at the
  568. PATH setting-- DOS tells it directly.  This makes it an
  569. excellent way to find the program's "home" directory, where
  570. (hopefully) any data files associated with the program will
  571. also be stored.
  572.  
  573.    SelfName$ = SPACE$(80)
  574.    GetExecPath SelfName$, SelfLen%
  575.    SelfName$ = LEFT$(SelfName$, SelfLen%)
  576.  
  577. -------
  578. SelfName$   full path for current program.  Init to 80+ chars.
  579. SelfLen%    length of the full path spec.
  580.  
  581.  
  582. Name  : GetKbd
  583. Class : Input
  584. Level : Clone
  585.  
  586. The GetKbd routine allows you to get the state of the four keyboard toggles:
  587. Insert, Caps lock, Num lock, and Scroll Lock.
  588.  
  589.    GetKbd Insert%, Caps%, Num%, Scrl%
  590.  
  591. -------
  592. Insert%    whether "insert" mode is on (0 if no)
  593. Caps%      whether "caps lock" is on (0 if no)
  594. Num%       whether "num lock" is on (0 if no)
  595. Scrl%      whether "scroll lock" is on (0 if no)
  596.  
  597.  
  598. Name  : GetKbd1
  599. Class : Input
  600. Level : Clone
  601.  
  602. The GetKbd1 routine allows you to get the state of the four keyboard shift
  603. keys: Left shift, Right shift, Control and Alt.
  604.  
  605.    GetKbd1 LShift%, RShift%, Control%, Alt%
  606.  
  607. -------
  608. LShift%    whether the left shift key is depressed (0 if no)
  609. RShift%    whether the right shift key is depressed (0 if no)
  610. Control%   whether a control key is depressed (0 if no)
  611. Alt%       whether an alt key is depressed (0 if no)
  612.  
  613.  
  614. Name  : GetKbd2
  615. Class : Input
  616. Level : AT BIOS
  617.  
  618. The GetKbd2 routine allows you to get the state of the six keyboard shift
  619. keys on an "enhanced" keyboard: Left shift, Right shift, Left Control, Right
  620. Control, Left Alt and Right Alt.
  621.  
  622. Normally, the BIOS only lets you see one key at a time, which can be a
  623. barrier when you need more input.  This is a particular problem with action
  624. games and other real-time applications which have complex input requirements.
  625. Due to the special way the BIOS treats shift keys, GetKbd2 can tell if the
  626. the various shift keys are pressed simultaneously, allowing more flexibility.
  627.  
  628.    GetKbd2 LShift%, RShift%, LCtrl%, RCtrl%, LAlt%, RAlt%
  629.  
  630. -------
  631. LShift%    whether the left shift key is depressed (0 if no)
  632. RShift%    whether the right shift key is depressed (0 if no)
  633. LCtrl%     whether the left control key is depressed (0 if no)
  634. RCtrl%     whether the right control key is depressed (0 if no)
  635. LAlt%      whether the left alt key is depressed (0 if no)
  636. RAlt%      whether the right alt key is depressed (0 if no)
  637.  
  638. Name  : GetLIMHandles
  639. Class : Memory
  640. Level : DOS
  641.  
  642. Early Lotus/Intel/Microsoft expanded memory revisions provided a limited
  643. number of "handles" which could be used to access expanded memory-- often as
  644. few as 15 or so.  If your program uses expanded memory and the EMS driver is
  645. one of the older versions, you may want to make sure that enough handles are
  646. available.  This routine tells you how many handles are in use.
  647.  
  648. Note that this routine expects an EMS driver to be installed.  If you can't
  649. be sure of that, use GetLIMM first to avoid an unpleasant surprise.
  650.  
  651.    GetLIMHandles Handles%
  652.  
  653. -------
  654. Handles%  number of EMS handles in use
  655.  
  656. Name  : GetLIMM
  657. Class : Memory / Equipment
  658. Level : DOS
  659.  
  660. This routine tells you how much expanded memory is installed.  If there is
  661. none, or if the EMS driver hasn't been installed, it returns zeroes.  You
  662. should use this routine before any other of the PBClone routines that access
  663. expanded memory, since the other routines expect EMS to be available.
  664.  
  665. The results are returned in terms of EMS pages.  Each page is 16 kilobytes.
  666.  
  667.    GetLIMM TotalPages%, FreePages%
  668.  
  669. -------
  670. TotalPages%  number of EMS pages installed
  671. FreePages%   number of EMS pages available for use
  672.  
  673.  
  674. Name  : GetLIMV
  675. Class : Memory / Equipment
  676. Level : DOS
  677.  
  678. The GetLIMV routine tells you the version of EMS driver that is being used.
  679. The version number is separated into major and minor parts.  For example, an
  680. EMS 3.1 driver would return a major number of 3 and minor number of 1.
  681.  
  682. Note that this routine expects an EMS driver to be installed.  If you can't
  683. be sure of that, use GetLIMM first to avoid an unpleasant surprise.
  684.  
  685.    GetLIMV MajorVer%, MinorVer%
  686.  
  687. -------
  688. MajorVer%  major part of the EMS version number
  689. MinorVer%  minor part of the EMS version number
  690.  
  691. Name  : GetTView             (Get TopView)
  692. Class : Miscellaneous
  693. Level : BIOS
  694.  
  695. This routine tells you whether TopView or a compatible multitasker (such as
  696. TaskView or DESQview) is loaded.
  697. See also GetDView, GetTVScreen, UpdTVScreen.
  698.  
  699.    GetTView Installed%
  700.  
  701. -------
  702. Installed%   whether a TopView-type multitasker is loaded (0 no)
  703.  
  704. Name  : GetTVScreen          (Get TopView Screen address)
  705. Class : Display / Miscellaneous
  706. Level : BIOS
  707.  
  708. GetTVScreen returns the address of the screen buffer used by a TopView-type
  709. multitasker.  This allows you to use direct screen access while remaining
  710. within the windows allocated to your program by the multitasker.
  711.  
  712. You must tell the multitasker the address of the screen you would be writing
  713. to if the multitasker was not installed.  Specify a segment of &HB000 if
  714. using an MDA or Hercules, or a segment of &HB800 for CGA, EGA, MCGA or VGA.
  715. The offset should always be 0.  This is for use in text modes.
  716.  
  717. The routine will return with the new segment and offset for you to use.
  718. These values can be used with any PBClone screen routine that accepts a
  719. segment and offset-- DQPrint and DXQPrint, for example.
  720.  
  721. Note that not all TopView-compatible multitaskers will automatically update
  722. the screen from the buffer.  The UpdTVScreen routine allows you to force a
  723. screen update.
  724. See also GetDView, GetTView, UpdTVScreen.
  725.  
  726.    GetTVScreen DSeg%, DOfs%
  727.  
  728. DSeg%       segment of desired screen
  729. DOfs%       offset of desired screen
  730. -------
  731. DSeg%       segment of screen buffer
  732. DOfs%       offset of screen buffer
  733.  
  734.  
  735. Name  : KbdType
  736. Class : Input / Equipment
  737. Level : Clone
  738.  
  739. This routine tells you if an enhanced (101-key) keyboard is available.
  740.  
  741. KbdType differs from the ProBas routine of the same name in that it has
  742. additional error checking.  If it is not entirely sure that an enhanced
  743. keyboard is available, it plays safe and assumes there isn't one.  This
  744. avoids possible disaster on older PCs.
  745.  
  746.    KbdType Enhanced%
  747.  
  748. -------
  749. Enhanced%    whether keyboard is of the enhanced type (0 no)
  750.  
  751.  
  752. Name  : LClose
  753. Class : Memory
  754. Level : BIOS
  755.  
  756. This routine closes a block of expanded memory that was opened for access by
  757. LOpen.  It is important to close the block when you are finished with it, to
  758. return it to the free memory pool.
  759.  
  760. Routines in this suite include: LOpen, LGet, LPut, LClose.
  761.  
  762.    LClose EMSHandle%
  763.  
  764. EMSHandle%    handle of the expanded memory block
  765.  
  766.  
  767. Name  : LGet
  768. Class : Memory
  769. Level : BIOS
  770.  
  771. This routine gets a block of data from expanded memory that was opened for
  772. access by LOpen.  The amount of data is specified in words; one word is the
  773. same as two bytes.  An integer takes up a word, long integers and single
  774. precision numbers require two words, and double precision numbers take four.
  775.  
  776. Routines in this suite include: LOpen, LGet, LPut, LClose.
  777.  
  778.    LGet EMSHandle%, DSeg%, DOfs%, Words%
  779.  
  780. EMSHandle%    handle of the expanded memory block
  781. DSeg%         segment of place to store data
  782. DOfs%         offset of place to store data
  783. Words%        words to get from expanded memory
  784.  
  785.  
  786. Name  : LOpen
  787. Class : Memory
  788. Level : BIOS
  789.  
  790. This routine opens a block of expanded memory for access.  The size of the
  791. block is specified in words; one word is the same as two bytes.  An integer
  792. takes up a word, long integers and single precision numbers require two
  793. words, and double precision numbers take four.  This allows you to store up
  794. to 64K in each EMS block that you open.
  795.  
  796. Note that LOpen expects an EMS driver to be available.  If you are not
  797. certain on this point, use GetLIMM beforehand to make sure.
  798.  
  799. Routines in this suite include: LOpen, LGet, LPut, LClose.
  800.  
  801.    LOpen Words%, EMSHandle%, ErrCode%
  802.  
  803. Words%        size of expanded memory block to allocate
  804. -------
  805. EMSHandle%    handle of the expanded memory block
  806. ErrCode%      error code (0 if no error)
  807.  
  808. Name  : LPut
  809. Class : Memory
  810. Level : BIOS
  811.  
  812. This routine puts a block of data into expanded memory that was opened for
  813. access by LOpen.  The amount of data is specified in words; one word is the
  814. same as two bytes.  An integer takes up a word, long integers and single
  815. precision numbers require two words, and double precision numbers take four.
  816.  
  817. Routines in this suite include: LOpen, LGet, LPut, LClose.
  818.  
  819.    LPut EMSHandle%, DSeg%, DOfs%, Words%
  820.  
  821. EMSHandle%    handle of the expanded memory block
  822. DSeg%         segment of place from which to get data
  823. DOfs%         offset of place from which to get data
  824. Words%        words to put into expanded memory
  825.  
  826. Name  : LRotate
  827. Class : String
  828. Level : Any
  829.  
  830. Many years ago, I wrote one of the first terminal programs for the PC.  It
  831. died a horrible death when Qmodem came out... sigh.  This routine comes from
  832. that experience.  It rotates the characters in a string left once (e.g.,
  833. "ABCDE" becomes "BCDEA").  I used this in my routine to dial a list of BBSes,
  834. skipping to the next one if the current one was busy.
  835.  
  836. LRotate can also be handy for things like scrolling a long message across the
  837. screen (you just PRINT LEFT$(Message$, 80); then delay a bit, LRotate and do
  838. it again).
  839.  
  840.    LRotate St$
  841.  
  842. St$     string to be rotated left once
  843. -------
  844. St$     string after being rotated left once
  845.  
  846.  
  847. Name  : NameCase                (Called by DoorFrame - DON'T DELETE!)
  848. Class : String
  849. Level : Any
  850.  
  851. This routine provides a specialized uppercase/lowercase converter designed
  852. especially for names.  It converts the first letter in each word in a string
  853. to uppercase, with the rest of the word being converted to lowercase.
  854.  
  855. See also NameCase2, the FUNCTION version of this routine.
  856.  
  857.    NameCase St$
  858.  
  859. St$         string to process
  860. -------
  861. St$         processed string
  862.  
  863.  
  864. Name  : NameCase2$           (Name Case)
  865. Class : String
  866. Level : Any
  867.  
  868. This routine provides a specialized uppercase/lowercase
  869. converter designed especially for names.  It converts the first
  870. letter in each word in a string to uppercase, with the rest of
  871. the word being converted to lowercase.
  872.  
  873. See also NameCase, the SUB version of this routine.
  874.  
  875.    Result$ = NameCase2$(St$)
  876.  
  877. St$         string to process
  878. -------
  879. Result$     processed string
  880.  
  881.  
  882. Name  : Processor
  883. Class : Equipment
  884. Level : Any
  885.  
  886. Processor returns the type of processor (CPU) installed.
  887.  
  888. Results are returned as follows:
  889.  
  890.    0    NEC V20
  891.    1    8088 or 8086
  892.    2    80186
  893.    3    80286
  894.    4    80386 or 80486
  895.  
  896.    Processor ProcType%
  897.  
  898. -------
  899. ProcType%    type of CPU (see above)
  900.  
  901.  
  902. Name  : Retries
  903. Class : Disk
  904. Level : DOS 3.1+
  905. This routine allows you to adjust the handling of file-sharing errors.  When
  906. such an error occurs, DOS normally retries 3 times, with a wait of 1 between
  907. tries.  This allows temporary conditions, such as someone else using the file
  908. you want to access, to clear up.  In many cases, though, you may want to
  909. change this delay.  A shorter delay will improve response time, allowing your
  910. program to handle the error more quickly.  A longer delay may be more suited
  911. for a busy network, allowing the request to proceed after a reasonable
  912. waiting period.
  913.  
  914. The delay period between each retry is unfortunately machine-dependent, i.e.,
  915. you will need larger delays on faster machines to achieve the same effect.
  916. This can only be considered a flaw in DOS.
  917.  
  918. Note that shorter waiting periods will improve response time for your
  919. program, but may adversely affect the network.  Normally, you should use the
  920. longest waiting period with which you feel comfortable.
  921.  
  922.    Retries Times%, WaitTime%
  923.  
  924. Times%     number of times to retry if a file-sharing violation occurs
  925. WaitTime%  amount of time to delay between retries
  926.  
  927. Name  : Reverse              (Reverse)
  928. Class : String
  929. Level : Any
  930. This little fellow reverses the order of the characters in a
  931. string.  It is one of the vital components of RInstr, but other
  932. than that I see no real use for it.  On the other hand, George
  933. Boole thought that Boolean logic was of solely theoretical
  934. interest, and yet without it there would be no computers. I
  935. leave it to you to find the earth-shattering possibilities of
  936. Reverse!
  937.  
  938.    Reverse St$
  939.  
  940. St$      string to be reversed
  941. -------
  942. St$      reversed string
  943.  
  944. Name  : RInstr               (Reverse INSTR)
  945. Class : String
  946. Level : Any
  947. Like INSTR, this routine tells you the position of a substring
  948. within a string.  A "reverse" search is used, however-- whereas
  949. INSTR tells you the first match, RInstr tells you the last
  950. match.  Similarly, whereas INSTR will tell you that a null
  951. search string matches the main string at the first position,
  952. RInstr will match on the last position.  Of course, most of the
  953. time you won't be searching for a null string!
  954.  
  955.    RInstr MainSt$, SeekSt$, Posn%
  956.  
  957. MainSt$    string to search
  958. SeekSt$    string for which to search
  959. -------
  960. Posn%      position of substring within main string (0 no match)
  961.  
  962.  
  963. Name  : Sec2Time$            (Seconds to Time)
  964. Class : Time
  965. Level : Any
  966.  
  967. This routine converts the number of seconds past midnight into
  968. a time string.
  969.  
  970.    TimeSt$ = Sec2Time$(Seconds&)
  971.  
  972. Seconds&   number of seconds past midnight
  973. -------
  974. TimeSt$    time string (TIME$ format)
  975.  
  976. Name  : SetError
  977. Class : Miscellaneous
  978. Level : DOS
  979. The SetError routine allows you to set the "error level" to be returned by
  980. DOS when your program ends.  This is particularly handy for returning
  981. information to batch files.
  982. Note that SetError is best used just before your program ENDs, to avoid
  983. complications.
  984.  
  985.    SetError ErrorLevel%
  986.  
  987. ErrorLevel%   exit code to be returned by your program
  988.  
  989. Name  : SetKbd
  990. Class : Input
  991. Level : Clone
  992. The SetKbd routine allows you to set the state of any of the four keyboard
  993. toggles: Insert, Caps lock, Num lock, and Scroll Lock.  You can give your
  994. input routines a professional touch by setting this toggles instead of making
  995. the user remember to do so.
  996.  
  997. It's considered proper to restore the original keyboard toggles before your
  998. program exits, unless of course the purpose of the program is to leave the
  999. toggles in a particular state!  The GetKbd routine can be used in conjunction
  1000. with SetKbd to do this.
  1001.  
  1002.    SetKbd Insert%, Caps%, Num%, Scrl%
  1003.  
  1004. Insert%    whether to turn on "insert" mode (0 if no)
  1005. Caps%      whether to turn on "caps lock" (0 if no)
  1006. Num%       whether to put the keypad into numeric mode (0 if no)
  1007. Scrl%      whether to turn on "scroll lock" (0 if no)
  1008.  
  1009. Name  : Time2Sec&            (Time to Seconds)
  1010. Class : Time
  1011. Level : Any
  1012. This routine converts a time string into the number of seconds
  1013. past midnight. This is convenient if you want to find the
  1014. difference between two times or to calculate what time it will
  1015. be after a given interval.
  1016.  
  1017.    Seconds& = Time2Sec&(TimeSt$)
  1018.  
  1019. TimeSt$    time string (TIME$ format)
  1020. -------
  1021. Seconds&   number of seconds past midnight
  1022.  
  1023.  
  1024. Name  : TInstr               (Typed INSTR)
  1025. Class : String
  1026. Level : Any
  1027. As you might guess from the "Instr" part of the name, this
  1028. routine searches a string.  Instead of searching for a specific
  1029. character or substring, though, it looks for a specific type of
  1030. character-- letters, numbers, control codes, or whatever.  You
  1031. can search for the first of a combination of types, too, which
  1032. also allows searching for "anything but" a specific type.
  1033.  
  1034. The character type code is specified by adding any of the
  1035. following:
  1036.  
  1037.     1    alphabetic
  1038.     2    numeric
  1039.     4    symbolic
  1040.     8    control
  1041.    16    graphics
  1042.    32    space
  1043. The TInstr routine is handy for parsing and cleaning up user
  1044. input, among other uses.
  1045.  
  1046.    TInstr St$, ChrType%, Place%
  1047.  
  1048. St$          string to search
  1049. ChrType%     type of character(s) to search for
  1050. -------
  1051. Place%       position of first char of desired type, or 0
  1052.  
  1053. Name  : UnCalcAttr           (Undo Calculated Attribute)
  1054. Class : Display
  1055. Level : Any
  1056.  
  1057. Many of the display routines in this library require an
  1058. "attribute" rather than foreground and background colors.  An
  1059. attribute is a combination of the foreground and background
  1060. colors in a format which is used by all types of displays when
  1061. in text mode.  The UnCalcAttr routine allows you to decode the
  1062. original colors given the attribute.
  1063.  
  1064. Foreground colors are usually specified as 0-31, with
  1065. backgrounds as 0-7.
  1066.  
  1067.    UnCalcAttr Foreground%, Background%, Attr%
  1068.  
  1069. Attr%         color "attribute"
  1070. -------
  1071. Foreground%   foreground color
  1072. Background%   background color
  1073.  
  1074.  
  1075. Name  : UpdTVScreen          (Update TopView Screen)
  1076. Class : Display
  1077. Level : BIOS
  1078. UpdTVScreen tells a TopView-compatible multitasker to update the screen using
  1079. a specified screen buffer (use GetTVScreen to get the buffer location).  Some
  1080. multitaskers will do this automatically, but some won't.  It's safe to use
  1081. this routine either way.
  1082.  
  1083. See also GetDView, GetTView, GetTVScreen.
  1084.  
  1085.    UpdTVScreen DSeg%, DOfs%
  1086.  
  1087. DSeg%       segment of screen buffer
  1088. DOfs%       offset of screen buffer
  1089.  
  1090. Name  : WinCheck             (Windows Check)
  1091. Class : Equipment
  1092. Level : BIOS
  1093. The WinCheck routine tells you what version of Microsoft Windows is in use,
  1094. if any.  It returns the results as two integers containing the major and
  1095. minor version numbers.  For instance, Windows 3.0 would return a major number
  1096. of 3, minor 0.  Windows/386 v2.x will be identified as 2.0.  If Windows is
  1097. not running, 0.0 will be returned.  NOTE that this routine is not able to
  1098. detect Windows 1.x versions!
  1099.  
  1100.    WinCheck MajorV%, MinorV%
  1101.  
  1102. -------
  1103. MajorV%   major part of the Windows version
  1104. MinorV%   minor part of the Windows version
  1105.  
  1106.  
  1107.